package com.ybkj.daijia.server.service;

import com.ybkj.daijia.common.Result;
import com.ybkj.daijia.page.Page;
import com.ybkj.daijia.server.mc.Enterprise;
import com.ybkj.daijia.server.mc.Passenger;
import com.ybkj.daijia.server.mc.PassengerAccount;
import com.ybkj.daijia.server.mc.PassengerAccount.PayType;
import com.ybkj.daijia.server.mc.PassengerAddress;
import com.ybkj.daijia.server.mc.PassengerConcats;
import com.ybkj.daijia.server.mc.PassengerGrade;
import com.ybkj.daijia.server.model.PayRecord;
import com.ybkj.daijia.server.model.PhoneSmsRecord;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpSession;

/**
 * @author Shine
 */
public interface MemberService {

    /**
     * @param name
     * @param fromSource
     * @param phone
     * @param carNumber
     * @param type
     * @return name为null则查询出所有的信息，否则只查询出与name匹配的信息
     */
    public Page<Passenger> queryAll(Integer type, Long gradeId, Long companyId, String startTime,
        String endTime, String param);

    public Page<Passenger> findAll(Integer type, Long gradeId, Long companyId, String startTime,
        String endTime, String param);

    public Page<Passenger> queryAll(Integer type, Long gradeId, Long companyId, String startTime,
        String endTime);

    public Page<Map<String, Object>> queryByIntroducer(String introducer, Integer introduceType,
        Integer page, Integer limit);

    /**
     * 根据主键删除会员信息
     *
     * @param member
     */
    public Result<Passenger> delete(Passenger passenger);

    public Result<Enterprise> deleteEnterprise(Enterprise enterprise);

    public void getCodeV3(String phone, Double longitude, Double latitude, String acKey);

    public Map<String, Object> login(String phone, String name, Integer gender, Passenger passenger,
        PhoneSmsRecord phoneSmsRecord, String appversion, String introducer, Double longitude,
        Double latitude, String password);

    /**
     * 根据身份证查询会员信息
     *
     * @param idCard
     * @return
     */
//	public Passenger findByIdCard(String idCard);

    /**
     * 根据电子邮件查询会员信息
     *
     * @param email
     * @return
     */
//	public Passenger findByEmail(String email);

    /**
     * 充值逻辑
     *
     * @param trade_no
     * @param admin
     */
    public void cashRecharge(PayRecord payRecord, String trade_no);

    /**
     * 查询所有会员信息
     *
     * @return
     */
//	public List<Passenger> findAll();

    /**
     * 根据公司查询所有会员信息
     *
     * @param companyId
     * @return
     */
//	public List<Passenger> findByCompany(Long companyId);

    /**
     * 根据主键更新会员信息
     *
     * @param member
     * @return
     */
//	public int updateByPrimaryKey(Passenger member);

//	public int updateByAlreadyMoney(Passenger member);//修改客户消费现金金额

    /**
     * 增加余额
     *
     * @param money
     * @param memberId
     * @return
     */
//	public int addVirtual(BigDecimal money, Long memberId);


    /**
     * new
     */
    public List<PassengerGrade> listAllGrades();

    public Page<PassengerGrade> listGrades();

    public Result<Passenger> createPersonal(Passenger passenger);

    public Passenger findOnePassenger(Long id);

    public Passenger findOnePassengerByPhone(String phone);

    public Result<Passenger> updatePersonal(Passenger passenger);

    public Result<Passenger> updatePassenger(Passenger passenger);

    public Result<PassengerAccount> money(Passenger passenger, Long introducerId, BigDecimal money,
        String memo, String operating, PayType payType, Long orderId, String orderNo,
        Integer orderType, String tradeNo, Boolean updateBlance, Boolean useNoDrawMoney);

    public Result<PassengerAccount> moneyEnterprise(Enterprise enterprise, BigDecimal money,
        String memo, String operating, PayType payType, Long orderId, String orderNo,
        Integer orderType, String tradeNo, Boolean updateBlance, Boolean useNoDrawMoney);

    public Page<Enterprise> queryAllEnterprise(Long gradeId, Long companyId, String startTime,
        String endTime, String param);

    public Enterprise findOneEnterprise(Long id);

    public Result<Enterprise> createEnterprise(Enterprise enterprise);

    public Page<Passenger> queryAllBlack(Long companyId, String param);

    public Result<Passenger> unblack(Passenger passenger);

    public Result<Passenger> black(Passenger passenger);

    public Result<Enterprise> updateEnterprise(Enterprise enterprise);

    public String findCid(Long passengerId);

    public Result<Passenger> bindDevice(Passenger passenger);

    public PassengerAddress findUsuallyAddress(Long passengerId, Integer type);

    public Result<PassengerAddress> updateUsuallyAddress(Long passengerId, String address,
        Double addressLat, Double addressLng, Integer type);

    public Result<PassengerConcats> updateEcnEcp(Passenger passenger, String memberEcn,
        String memberEcp);

    public Passenger findOnePassengerByEmail(String email);

    public Passenger findOnePassengerByIdCard(String idCard);

    public List<Passenger> findAllPassengersByPhone(String phone);

    public Result<PassengerGrade> createGrade(PassengerGrade passengerGrade);

    public Result<PassengerGrade> updateGrade(PassengerGrade passengerGrade);

    public Page<Passenger> findByMultiCondition(Integer[] type, Long[] grade,
        Long[] companyIds, Boolean[] permission, Integer[] isPlatform, String startTime,
        String endTime, String phone, String name, String carNumber, String introduceName,
        Integer page, Integer rows);

    public Page<Enterprise> queryAllEnterpriseByParams(String name,
        Long[] greade, String address, String companyName,
        String startTime, String endTime);

    public PassengerGrade findOneGrade(Long id);

    public List<PassengerGrade> findByCompany(Long companyId);

    public void changeCompanyAbbreviation(Long companyId, String abbreviation);

    Result<Map<String, Object>> batchCreate(String data);

    public boolean deleteGrade(Long gradeId);

    public boolean disposeGrade(Long gradeId);

    /**
     * 乘客上报
     */
    void checkMember(Long[] ids, HttpSession session);

    Map<String, Object> uploadMember(Long[] ids);

    public Map<String, Object> getCodeV4(String phone, Double longitude, Double latitude,
        String acKey);

    public Map<String, Object> loginV1(String phone, String name, Integer gender,
        Passenger passenger, PhoneSmsRecord phoneSmsRecord, String appversion, String introducer,
        Double longitude, Double latitude, String password);

}
